#include <stdio.h>
#include <netinet/in.h>

int main(int argc, char *argv[])
{
    unsigned long local;
    unsigned short port;
    local = 123456789;
    port = 2012;
    printf("NET(big-endian)    :%d\n",htonl(local));
    printf("NET(big-endian)    :%d\n",htons(port));
    printf("HOST(little-endian):%d\n",ntohl(htonl(local)));
    printf("HOST(little-endian):%d\n",ntohs(htons(port)));

    return 0;
}
